﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComposantMappage
{
    class MAPP_TB_SITES
    {
        private FactoryMessage.STGMSG oMsg;
        private string rq_sql;

        public FactoryMessage.STGMSG select()
        {
            this.rq_sql = "SELECT [id_site] FROM [TB_SITES];";
            this.oMsg = FactoryMessage.MSG_FACTORY.msg_factory("", new object[] { (object)rq_sql }, "", "", "", true, "");

            return this.oMsg;
        }

        public FactoryMessage.STGMSG selectBySite(FactoryMessage.STGMSG oMsg)
        {
            string sites;
            sites = (string)oMsg.Data[0];
            this.rq_sql = "SELECT id_site FROM TB_SITES WHERE (id_site = '" + sites + "')";
            this.oMsg = FactoryMessage.MSG_FACTORY.msg_factory("", new object[] { (object)rq_sql }, "", "", "", true, "");

            return this.oMsg;
        }

        public FactoryMessage.STGMSG insert(FactoryMessage.STGMSG oMsg)
        {
            string sites;

            sites = (string)oMsg.Data[0];
            this.rq_sql = "INSERT INTO TB_SITES (id_site) VALUES ('" + sites + "');";
            this.oMsg = FactoryMessage.MSG_FACTORY.msg_factory("", new object[] { (object)this.rq_sql }, "", "", "", true, "");

            return this.oMsg;
        }
    }
}
